﻿using System.IO;
using System;

namespace ShpMerger
{
    internal class ExtendBinaryReader : BinaryReader
    {
        private int wordNumber; //the word byte length

        public ExtendBinaryReader(Stream theClass)
            : base(theClass)
        {
            wordNumber = 4;
        }

        public int ReadUsingBigEndian()
        {
            byte[] TempBytes = this.ReadBytes(wordNumber);
            Array.Reverse(TempBytes);
            return BitConverter.ToInt32(TempBytes, 0);
        }
    }
}
